<?php 
namespace app\app\validate;
use think\Validate;

class Address extends Validate{

	protected $rule = [
		'name'    => 'require|max:10',
		'phone'   => 'require|number|length:11',
		'address' => 'require|length:1,50',
		'details' => 'require|length:1,50'
	];	

	protected $message = [
		'name.require' => '联系人必填',
		'name.max'     => '联系人最多不超过10个字符',
		'phone.require'=> '手机号码必填',
		'phone.number' => '电话号码必须全为数字',
		'phone.length' => '电话号码长度为11位',
		'address.require' => '地址必填',
		'address.length' => '地址长度在1至50个字符之间',
		'details.require' => '详细地址必填',
		'details.length' => '详细地址长度在1至50个字符之间'
	];
}